﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="DiplomProjectStateRepository.cs" company="">
//   Copyright (c) 2010/2011 All Right Reserved
// </copyright>
// <summary>
//   Contains DiplomProjectStateRepository class declaration.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace iBuproModel.Repositories.Classes
{
    using iBuproModel.Repositories.Interfaces;

    /// <summary>
    /// Implements IDiplomProjectStateRepository using linq to entities.
    /// </summary>
    public class DiplomProjectStateRepository : GenericRepository<DiplomProjectState>, IDiplomProjectStateRepository
    {
        public DiplomProjectState GetNewProjectState()
        {
            return this.First(s => s.Id == 1);
        }

        public DiplomProjectState GetBookedProjectState()
        {
            return this.First(s => s.Id == 2);
        }

        public DiplomProjectState GetLectorAcceptedProjectState()
        {
            return this.First(s => s.Id == 3);
        }

        public DiplomProjectState GetSubscribedProjectState()
        {
            return this.First(s => s.Id == 4);
        }

        public DiplomProjectState GetCanceledProjectState()
        {
            return this.First(s => s.Id == 5);
        }

        public DiplomProjectState GetDefendedProjectState()
        {
            return this.First(s => s.Id == 6);
        }

        public void SetNewProjectState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetNewProjectState();
        }

        public void SetBookedProjectState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetBookedProjectState();
        }

        public void SetLectorAcceptedState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetLectorAcceptedProjectState();
        }

        public void SetSubscribedState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetSubscribedProjectState();
        }

        public void SetCanceledState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetCanceledProjectState();
        }

        public void SetDefendedState(DiplomProject project)
        {
            project.DiplomProjectState = this.GetDefendedProjectState();
        }


    }
}
